package com.rzx.mybackend.mapper;

import com.rzx.mybackend.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * UserMapper
 *
 * @author renzhexian
 * @date 2025/7/15
 */
@Mapper
public interface UserMapper {
    /*
    根据用户名查询用户信息
     */
    @Select("SELECT * FROM sys_user WHERE user_name = #{userName}")
    User selectByUserName(String userName);

    /*
    插入新用户
     */
    void insert(User user);

    /*
    查询注册的用户名是否存在
     */
    int selectUserNameByUserName(String userName);

    /*
    条件查询用户基本信息
     */
    User selectUserDetails(User user);

    /*
    根据用户名查询用户ID
     */
    User selectAllByUserId(Long userId);
}
